home *** CD-ROM | disk | FTP | other *** search
- % -----------------------------------------------------------------------------
- % How to draw a BOX on screen *TERMINATE PRESCRIPTION*
- % -----------------------------------------------------------------------------
- %
- % Version : 1.00
- % Filename : BOXES.TSL
- % Company : BLOKKER+BLOKKER Software
- % Programmer : Joop Blokker
- % Module created : 09 Aug 1995
- % Latest revision : 09 Aug 1995
- % Language/version : Terminate Prescription 1.00
- % Remarks : Step by step method, using variables.
- %
- % -----------------------------------------------------------------------------
- %
- % How to paint a Box on screen in 4 easy steps:
- %
- % 1 - Which box ?
- % 2 - Which color?
- % 3 - Where on screen?
- % 4 - Do it!
- %
- % ----------------------------- Which Box ? ------------------
- %
- % Box type 0 - No Border Lines
- % Box type 1 - Single Border Lines
- % Box type 2 - Double Border Lines
- % Box type 3 - Double Top & Bottom + Single Sides
- % Box type 4 - Double Sides + Single Top & Bottom
- % Box type 5 - Corners *, Sides |, Top & Bottom -.
- % Box type 6 - Single Top & Bottom Lines Only
- % Box type 7 - Double Top & Bottom Lines Only
-
- Set BoxType = 3
-
- % ----------------------------- Which color ? ----------------
- %
- % 0 = black 4 = red 8 = grey 12 = light red
- % 1 = blue 5 = magenta 9 = light blue 13 = light magenta
- % 2 = green 6 = brown 10 = light green 14 = yellow
- % 3 = cyan 7 = white 11 = light cyan 15 = bright white
- %
- Set Foreground = 15 % Foreground color: Bright white
- Set BackGround = 4 % Background color: Red
-
- % Calculate color attribute:
- %
- Set ColorAttr = ForeGround + ( BackGround * 16)
-
- % ------------------------------ Where ? ---------------------
- % Now define coordinates on screen
- %
- Set TopLeftCol = 20 % Top Left Column
- Set TopLeftRow = 5 % Top Left Row
- Set LowerRightCol = 60 % Lower Right Column
- Set LowerRightRow = 15 % Lower Right Row
-
-
- ClearScreen
- Set SaveColor = GetAttrXY(1,1)
- SetAttr 7
-
- % ------------------------------ The Box ! -------------------
- %
- Box TopLeftCol, TopLeftRow, LowerRightCol, LowerRightRow, ColorAttr, BoxType
-
-
- WriteStr TopLeftCol+2, TopLeftRow+2, "The Box!"
- WriteStr 30,24,"Press Enter, please..."
- WaitEnter
-
- % simply change the variables:
- %
- Set TopLeftCol = TopLeftCol + 2
- Set TopLeftRow = TopLeftRow + 2
- Set LowerRightCol = LowerRightCol + 2
- Set LowerRightRow = LowerRightRow + 2
-
- Set BackGround = 1 % Background Blue
- Set ColorAttr = ForeGround + ( BackGround * 16) % recalculate attribute
-
- % ------------------------------ Another Box!-----------------
- %
- Box TopLeftCol, TopLeftRow, LowerRightCol, LowerRightRow, ColorAttr, BoxType
-
- WriteStr TopLeftCol+2, TopLeftRow+2, "Another Box!"
- WriteStr 30,24,"Press Enter, please..."
- WaitEnter
- SetAttr 7
- ClearScreen
-
- % ------------------------------ Let's play ------------------
- %
- Set ColorAttr = 15 % White on black
- for x,1,9,1
- Box x+20, x+1, x+50, x+11, ColorAttr+(x*16), 3
- WriteStr x+29,x+1," Terminate! "
- next
- WriteStr 17,22," Try High Intensity On/Off in Alt-O Color Set-up "
- WriteStr 29,24," Press Enter, please... "
- WaitEnter
-
- SetAttr = SaveColor
- ClearScreen
- TERMINATE
-